package com.ruoyi.web.controller.data;

import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.system.service.ISysDeptService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@RequestMapping(value = "/data/show")
@Controller
public class DataController {

    private String prefix = "/system/data";

    @RequiresPermissions("data:show:view")
    @GetMapping()
    public String dept()
    {
        return prefix + "/data";
    }


    @RequiresPermissions("data:show:list")
    @PostMapping("/list")
    @ResponseBody
    public List<SysDept> list()
    {
        int a =1;
        System.out.println(System.currentTimeMillis());
        List<SysDept> result =  deptService.selectDeptList2();
        int b = 3 + a;

        return result;
    }


    @Autowired
    private ISysDeptService deptService;

}
